import request from "@/utils/request";
import ConstTable from "./ConstTable";

// 打印预览
export function PrintPreview(data) {
    return request({
        url: `${ConstTable.BaseUrl}/Business/PrintExecute/fastreportpreview`,
        method: "POST",
        responseType: "arraybuffer",
        data
    });
}

// 打印
export function Print(data) {
    return request({
        url: `${ConstTable.BaseUrl}/Business/PrintExecute/fastreportprint`,
        method: "POST",
        responseType: "arraybuffer",
        data
    });
}

export function PrintZpl(data) {
    return request({
        url: `${ConstTable.BaseUrl}/Business/PrintExecute/fastreportzplprint`,
        method: "POST",
        responseType: "arraybuffer",
        data
    });
}

// 查询是否有默认打印配置
export function GetDefaultPrintConfig(data) {
    return request({
        url: `${
            ConstTable.BaseUrl
        }/Business/printconfigselect/GetDefaultPrintConfig`,
        method: "GET",
        data
    });
}

// 设置默认打印配置
export function SetDefaultPrintConfig(data) {
    return request({
        url: `${
            ConstTable.BaseUrl
        }/Business/printconfigselect/SetDefaultPrintConfig`,
        method: "GET",
        data
    });
}
